<include file="Public/header"/> 
<!-- start: Content -->
<div id="content" class="span10">
    <!--面包屑开始-->
    <ul class="breadcrumb">
        <li>
            <i class="icon-home"></i>
            <a href="index.html">Home</a> 
            <i class="icon-angle-right"></i>
        </li>
        <li><a href="#re">Tables</a></li>
    </ul>
    <!--面包屑结束-->
    <div class="row-fluid">
        <div class="box span12">
            <div class="box-header" data-original-title>
                <h2><i class="halflings-icon edit"></i><span class="break">修改问题:</span> </h2>
            </div>
     <div class="row-fluid">
        <div class="box span12">
          <div class="box-content">
             

             <if condition="($list.q_type eq 1)">
    <div class="tab-pane" id="custom">
                <p>
          <div id="form_question_type_a"  >
                 <form action="__APP__/Home/Questions/save" method="post" style="border: 1px solid #ccc;"  />
                <dl style="margin: 0  0 0 200px;"> 
                <input type ="hidden" name="q_id" value="{$list.q_id}" />
                <input type ="hidden" name="q_sid" value="{$list.q_sid}" />
                  <dt><label class="control-label" for="selectError">选择类型:</label>
                    <select id="selectError" name="subject">
        
                      <option name="{$data.id}">{$data.name}</option>
            

                    </select>
                  <dt><label class="form-title" for="question_content">问题:</label>
                    <textarea name="question_content" id="question_content"  style="width: 450px; height: 100px; resize:none;">{$list.q_content}</textarea>
                    </dt>
                    <dt><label class="form-title" for="solve_title_add">答案选项:</label></dt>
              <div id="type">    
                <div class="input-prepend" >
                  <span class="add-on">A</span ><input id="prependedInput" size="16" name="type_a" type="text" value="{$list.q_type_a}" >
                </div>
                </br>
                <div class="input-prepend">
                  <span class="add-on">B</span><input id="prependedInput" size="16" name="type_b"  type="text" value="{$list.q_type_b}" >
                </div>
                </br>
                <div class="input-prepend">
                  <span class="add-on">C</span><input id="prependedInput" size="16" name="type_c"  type="text" value="{$list.q_type_c}" >
                </div>
                </br>
                <div class="input-prepend">
                  <span class="add-on">D</span><input id="prependedInput" size="16" name="type_d"  type="text" value="{$list.q_type_d}" >
                </div>
                </br>
<!--                 <volist name="questions" id= "vo">
                     <div class="input-prepend">
                    <span class="add-on" id="span"></span><input id="prependedInput" size="16" name="type_d"  type="text" value="{$vo}" >
                  </div>
                  </br>
                </volist> -->
             </div>
                <div class="control-group">
                        <label class="control-label" for="inputEmail">正确答案:</label>
                        <div class="controls">
                          <input type="text" id="answer" name="answer" value="{$list.q_answer}">
                    </div>
                        <dt><label class="form-title" for="solve_images_add">图片url:</label>
                        <input type="texr" readonly="true" id="news_images" name="image_url" value="{$list.q_img}" />  <input value="点击上传图片" onclick="upImage();" type="button"/>
                        </dt>
                        <dl> 
                            <input type="submit" value="修改"/>
                  </form>
              </div>    
                </p>
               <else/>
           <div id="myTabContent" class="tab-content">
              <div class="tab-pane active" id="info">
                <p>
                 <div id="form_question_type_b"  style="display: block;">
                 <form action="__APP__/Home/Questions/save" method="post" style="border: 1px solid #ccc;"  />
                   <dl style="margin: 0  0 0 200px;">
                   <input type ="hidden" name="q_id" value="{$list.q_id}" />
                   <input type ="hidden" name="q_sid" value="{$list.q_sid}" />
                  <dt><label class="control-label" for="selectError">选择类型:</label>
                    <select id="selectError" name="subject">
                    <option name="{$data.id}">{$data.name}</option>
                    </select>
                 </dt>
                   <dt><label class="form-title" for="solve_add">问题:</label>
                    <textarea name="question_content" id="solve_overview_add"  style="width: 450px; height: 100px; resize:none;">{$list.q_content}</textarea>
                    </dt>
                    <dt><label class="form-title" for="solve_add">答案:</label>
                    <textarea name="answer" id="solve_function_add"  style="width: 450px; height: 100px; resize:none;">{$list.q_answer}</textarea>
                    </dt>
                        <dt><label class="form-title" for="solve_images_add">图片url:</label>
                        <input type="texr" readonly="true" id="news_img" name="image_url" value="{$list.q_img}" />  <input value="点击上传图片" onclick="upImage();" type="button"/>
                        </dt>
                  <input type="submit" value="修改"/>
                        </dl> 

                  </form>
                  </div>  
                </p>

              </div>
             
              </div>

             </if>
          
            </div>
          </div>
        </div><!--/span-->
      
      </div><!--/row-->     
    
{$question.q_type_e}
  </div><!--/.fluid-container-->

    <script type="text/plain" id="j_ueditorupload" style="height:5px;display:none;" ></script>
                        <!--注册百度ueditor-->  
                            <script>
                            //实例化编辑器
                            var o_ueditorupload = UE.getEditor('j_ueditorupload',
                                    {
                                        autoHeightEnabled: false
                                    });
                            o_ueditorupload.ready(function()
                            {
                                o_ueditorupload.hide(); //隐藏编辑器
                            });
                            //监听图片上传
                            o_ueditorupload.addListener('beforeInsertImage', function(t, arg)
                            {
                                // alert('这是图片地址：' + arg[0].src);
                                $("#news_img").val(arg[0].src);
                            });
                            //弹出图片上传的对话框
                            function upImage()
                            {
                                var myImage = o_ueditorupload.getDialog("insertimage");
                                myImage.open();
                            }
                                </script> 
  }
  <script type="text/plain" id="j_ueditorupload" style="height:5px;display:none;" ></script>
                        <!--注册百度ueditor-->  
                            <script>
                            //实例化编辑器
                            var o_ueditorupload = UE.getEditor('j_ueditorupload',
                                    {
                                        autoHeightEnabled: false
                                    });
                            o_ueditorupload.ready(function()
                            {
                                o_ueditorupload.hide(); //隐藏编辑器
                            });
                            //监听图片上传
                            o_ueditorupload.addListener('beforeInsertImage', function(t, arg)
                            {
                                // alert('这是图片地址：' + arg[0].src);
                                $("#news_images").val(arg[0].src);
                            });
                            //弹出图片上传的对话框
                            function upImage()
                            {
                                var myImage = o_ueditorupload.getDialog("insertimage");
                                myImage.open();
                            }

      var list = ["{$questions.q_type_e}","{$questions.q_type_f}","{$questions.q_type_g}","{$questions.q_type_h}","{$questions.q_type_i}","{$questions.q_type_j}","{$questions.q_type_k}","{$questions.q_type_l}","{$questions.q_type_m}","{$questions.q_type_n}"];
         var j  = 0;
         var arr = ['E','F','G','H','I','J','K','L','M','N'];
          for(var k =0; k<=9; k++){
              var data =arr[j] ;
              var v = list[j];
              if(v == ""){
                continue;
              };
              addType(data,v);
          }

  
                        /**
               * 添加选项
               * @param {type} 
               * @returns {undefined}
               */
              function addType(i,v){
                    var html =' <div class="input-prepend">';
                      html +='<span class="add-on">'+i+'</span><input id="prependedInput" size="16" name="type_'+i+'"  type="text" value="'+v+'">';
                      html +='</div>';
                      html +='</br>';
                   $('#type').append(html);
                   j++ ;
              }
    

         </script> 
         
          <include file="Public/footer"/>   
